<!DOCTYPE html>
<html>
<head>
    <title>Function Currying Example</title>
    <script type="text/javascript" src="EventUtil.js"></script>
</head>
<body>
    <p>This only works in browsers that natively support <code>Function.prototype.bind()</code>.</p>
    <input type="button" id="my-btn" value="Click Me" />
    <script type="text/javascript">
   
        var handler = {
            message: "Event handled",
        
            handleClick: function(name, event){
                alert(this.message + ":" + name + ":" + event.type);
            }
        };
        
        var btn = document.getElementById("my-btn");
        EventUtil.addHandler(btn, "click", handler.handleClick.bind(handler, "my-btn"));

    </script>
</body>
</html>
